1. Field of the Invention
The present invention relates to an image processing technique of recognizing the characteristics of input image data by, for example, obtaining the frequency distribution of the input image data and, more particularly, to an image processing apparatus and image processing method for the technique.
2. Description of the Related Art
Conventionally, there is available a technique based on frequency distribution (histogram) generation as a method for recognizing the characteristics of image data captured by an imaging apparatus such as a CCD (Charge Coupled Device) or a CMOS (Complementary Metal Oxide Semiconductor). This method is characterized in analyzing the number of pixels existing in the input image data captured by an imaging apparatus for each tone of pixel values in the main scanning direction and sub-scanning direction of the image data. This method uses values for discriminating the characteristics of image data and values dependent on a system which analyzes image data as elements (the tones of pixel values) constituting a frequency distribution or the intervals between pixel positions where sampling is performed or both of them. Examples of analysis on images using frequency distributions include under color determination for read image data, color count determination for a document (color document/monochrome document), determination for the presence/absence of a content such as characters and thin lines, and blank page determination.
An analysis based on a frequency distribution is used to adopt image correction parameters suitable for a specific object included in an image or to identify the boundary between an object and a background. Japanese Patent Laid-Open No. 10-210288 discloses a technique of segmenting the image captured by an imaging apparatus into a plurality of small images, generating a histogram of the level distribution of pixel signals constituting each small image, and specifying a small image including the boundary between an object and a background.
In such a frequency distribution analysis for each pixel value, the size of the image data of an analysis target need to be determined in advance to decide the pixel position where sampling is performed and perform uniform segmentation for small regions.
When reading a document using an ADF (Automatic Document Feeder), the size of image data is generally determined for the first time when the feeder completely reads one page of the document. It is therefore essential to store image data corresponding to one page. This requires a resource such as a memory or the like. In addition, a frequency distribution analysis is performed for the first time after the storage of image data corresponding to one page, and subsequent image processing is performed based on the analysis result. For this reason, a document reading process, a frequency distribution analysis process, and a subsequent image process constitute a critical path for processing corresponding to one page. This is a factor that determines a total processing time.
Attaching a sensor for document size detection to an ADF can detect a document size before reading operation. This, however, leads to a cost increase corresponding to the sensor. In addition, if document pages having different sizes are stacked in a mixed state, some sensor may detect a uniform size different from actual document sizes.